package com.time.sky.controller;

import com.time.sky.entity.Bank;
import com.time.sky.entity.Floor;
import com.time.sky.service.BankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class BankController {
    @Autowired
    private BankService bankService;

    @RequestMapping("queryBank")
    public List<Bank> queryBank(){
       return  bankService.queryBank();
    }
    @RequestMapping("addBank")
    public void addBank(Bank bank){
        bankService.addBank(bank);
    }
    @RequestMapping("/getCount1")
    public int getCount1(Bank bank){
        return bankService.getCount1(bank);
    }
    @RequestMapping("updateBank")
    public Bank updateBank(Bank bank){
        Bank updateBank = bankService.updateBank(bank);
        return updateBank;
    }
}
